<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>图书详情</title>
<link rel="stylesheet" type="text/css" href="css/bookdetail.css" />
<link rel="shortcut icon " type="images/x-icon" href="img/book.png">
</head>
<body>
<div class="nav">
	<img src="img/logo.png" alt="">
	<ul>
		<c:forEach var="i" items="${flist}">
    		<li>
      			<a href="tobooklist?fid=${i.category_id}">${i.category_name}</a>
    		</li>
    	</c:forEach>
	</ul>
</div>
<div class="ban">
	<img src="img/b1.jpg" alt="">
</div>
<div class="box">
	<div class="a">
		<div class="a1">
			<img src="./images/book/${book.book_image}" alt="">
			<div class="list1">
				<ul>
					<li><img src="./images/book/${book.book_image}" alt=""></li>
					<li><img src="./images/book/${book.book_image}" alt=""></li>
					<li><img src="./images/book/${book.book_image}" alt=""></li>
					<li><img src="./images/book/${book.book_image}" alt=""></li>
				</ul>
			</div>
		</div>
		
		<div class="a2">
			<h2>${book.book_name}</h2>
			<p>沉浸于书香之中，我看到青翠妩媚的山峦，在温润的春雨掩映下，尽显平淡天真，犹如三岛由一般叫人捉摸不透；我听到美妙的琴声，时而激扬，时而舒缓，令人心 情跌宕起伏，一如海明威出众的文采，屠格涅夫的字字韵律；我嗅到了梅兰袭人的清香，仿如林语堂的儒雅高贵，泰戈尔的清新淡泊。</p>
			<div class="price">
				<span>价格：</span>
				<span>￥${book.book_price}</span>
			</div>
			<div class="amount">
				<span>数量：</span>
				<button id="decrease">-</button>
				<span id="amount">1</span>
				<button id="increase">+</button>
			</div>
			<div class="serve">
				<span>服务：</span>
				<span>由“果果”发货，并提供售后服务。 明日19:15前完成下单，预计后天可送达</span>
			</div>
			<div class="cuxiao">
				<span>促销：</span><span class="item">满额减</span> <span class="tx">每满￥100减￥50</span><br>
				<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				<span class="item">加价购</span> <span class="tx">购买本商品可加价购其他商品一件</span><br>
				<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
				<span class="item">电子书</span>
				 
			</div>
			<div class="add">
				<a href="javascript:bookadd(${book.book_id},'gocart')">加入购物车</a>
				<a href="javascript:bookadd(${book.book_id},'gocart')">立即购买</a>
			</div>
		</div>
	</div>
	<div class="b">
		<h3>相关推荐</h3>
		<ul>
			<c:forEach var="i" items="${blist}">
				<li>
					<a href="tobookdetail?id=${i.book_id}">
						<img src="./images/book/${i.book_image}">
					</a>
					<p class="name">${i.book_name}</p>
					<p class="pri">￥${i.book_price}</p>
				</li>
			</c:forEach>
		</ul>
	</div>

	<div class="link">
		<ul>
			<li>购物指南</li>
			<li>购物流程</li>
			<li>发票制度</li>
			<li>服务协议</li>
			<li>会员优惠</li>
		</ul>
		<ul>
			<li>支付方式</li>
			<li>货到付款</li>
			<li>网上支付</li>
			<li>礼品卡支付</li>
			<li>银行转账</li>
		</ul>
		<ul>
			<li>订单服务</li>
			<li>配送服务查询</li>
			<li>订单状态查询</li>
			<li>取消订单</li>
			<li>修改订单</li>
		</ul>
		<ul>
			<li>配送方式</li>
			<li>当日递</li>
			<li>次日达</li>
			<li>订单自提</li>
			<li>验货签收</li>
		</ul>
	</div>
	
</div>

<div class="footer">
	<p>果果图书&copy;2020-2020公司版权所有 鲁ICP备000000-00备0000000000号</p> 
    <p>违法和不良信息举报电话：400-800-8200</p> 
</div>



<script>
	let amount = document.getElementById("amount")

	function bookadd(id,url){
		location.href="docartadd?id="+id+"&amount="+amount.innerHTML+"&url="+url;
	}
	//数量加减
	let decrease = document.getElementById("decrease")
	let increase = document.getElementById("increase")
	decrease.onclick = function(){
		if(amount.innerHTML > 1){
			amount.innerHTML = parseInt(amount.innerHTML) - 1
		}else{
			amount.innerHTML = 1
		}
	}
	increase.onclick = function(){
		if(amount.innerHTML < 10){
			amount.innerHTML = parseInt(amount.innerHTML) + 1
		}else{
			alert("限购10件")
			amount.innerHTML = 10
		}
	}
</script>
</body>
</html>